#==============================================================================
#	$Id: Makefile 22 2011-10-21 11:07:45Z sergey.kazenyuk $
#	$URL: http://spbau-cpp-2011.googlecode.com/svn/trunk/kazenyuk/hw02_rational/Makefile $
#==============================================================================

TARGET = rational
LIBS = 
DEBUG_DEFS = 
#DEBUG_DEFS = -D_DEBUG

CXX = g++
CXXFLAGS = -Wall -std=c++0x -pedantic -O0 -g -I inc $(DEBUG_DEFS)
LDFLAGS = $(LIBS)


all: prepare $(TARGET)

$(TARGET): obj/rational.o
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $?
obj/rational.o: src/rational.cpp
	$(CXX) $(CXXFLAGS) -c $< -o $@


.PHONY: clean clean-all rebuild prepare
clean: 
	-rm -f core $(TARGET)
	-rm -f src/*.o
	-rm -rf bin/* obj/*
clean-all: clean
	-rm -f *~ src/*~ inc/*~
	-rmdir bin obj
rebuild: clean all
prepare: 
	-mkdir -p obj bin

